package com.yhb.channel.impl.BJCJ;

import com.yhb.channel.provider.IUtilProvider;
import com.yhb.channel.utils.ConfigGetter;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Data
@Service
public class BJCJConfig {
    @Autowired
    private IUtilProvider utilProvider;

    private ConfigGetter configGetter;

    private String sysId;
    private String privateKey;

    @PostConstruct
    private void init() {
        configGetter = new ConfigGetter(BJCJChannel.CHANNEL_BASE_TYPE, utilProvider);
        privateKey = configGetter.getProperty("privateKey");
        sysId = configGetter.getProperty("sysId");
    }
}
